package com.learn.jdk.caseDemo;

import org.junit.Test;

import java.util.function.BiFunction;
import java.util.function.Supplier;
import java.util.stream.Stream;

/**
 * @author: lipan
 * @date: 2021/5/6 20:58
 */

public class StreamGenerateTest {


    public static void main(String[] args) {


        BiFunction<String, String, Obj> fun1 = Obj::new;
        Stream.generate(()->fun1.apply("1","2")).limit(10).forEach(System.out::println);


    }


}
    class  Obj{

        private  String id;

        private String name;

        public Obj(String id, String name) {
            this.id = id;
            this.name = name;
        }

        @Override
        public String toString() {
            return "Obj{" +
                    "id='" + id + '\'' +
                    ", name='" + name + '\'' +
                    '}';
        }
    }





